<script setup>
import { useRouter } from 'vue-router';
import TabBar from './components/TabBar.vue';


const router = useRouter()

const onClickLeft = () =>{
  if(history.length > 1){
    router.back();

  } else {
    router.push({name: 'home'})
  }
}
</script>

<template>
  <van-nav-bar
    :title="$route.meta.title"
    :left-arrow="$route.meta.isShowBack || false"
    @click-left="onClickLeft"
    fixed
    placeholder
  />
  <div style="padding-bottom: 50px;">
    <RouterView />
  </div>
  <TabBar />
</template>


<style lang="scss" scoped>

</style>